-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix retrieving probe logs by target name when probed by multiple modules #1257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Fix retrieving probe logs by target name when probed by multiple modules #1257
Conversation
dabf913 to
4f0f1f6
Compare
4f0f1f6 to
b9628bc
Compare
|
rebased onto latest |
/logs?module= filter parameterb9628bc to
a16959b
Compare
This allows to uniquely identify a probe by target and module. Previously with the `?target=` selector only, it was impossible to select the correct probe log, when multiple modules had probed a target. Signed-off-by: Norwin Roosen <[email protected]>
Signed-off-by: Norwin Roosen <[email protected]>
a16959b to
7b6bc9e
Compare
|
not stale, just waiting for review... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
few nits and a comment, rest lgtm.
can you also update the PR description as per the new PR template: https://github.com/prometheus/blackbox_exporter/blob/master/.github/PULL_REQUEST_TEMPLATE.md
| if resultFalse.Target != "target-1" { | ||
| t.Errorf("Error finding the result in history by target for target: expected \"%s\" and got \"%s\"", "target-1", resultFalse.Target) | ||
| } | ||
| if resultFalse.ModuleName != "module-1" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we also have "module-0", "target-1" entry, so shouldn't we check for both?
|
|
||
| // Get returns a given result by url. | ||
| func (rh *ResultHistory) GetByTarget(target string) *Result { | ||
| // GetByTarget returns a given result by url, optionally filtered by a module name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe we should rename the method to show that module is also supported.
Followup to #1063, which landed in 0.25.0:
When fetching logs of probes, this added URL query parameter allows to uniquely identify a probe log by target and module.
Previously with the
?target=selector only (added in #1063), it was impossible to select the correct probe log, when multiple modules had probed a target.In other words - this addition is a requirement, for reliably linking to the latest log of a probe with a given module (for example from dashboards).